package com.ruoyi.xst.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.xst.mapper.AccessRecordMapper;
import com.ruoyi.xst.domain.AccessRecord;
import com.ruoyi.xst.service.IAccessRecordService;

/**
 * 门禁记录Service业务层处理
 * 
 * @author Rambo
 * @date 2024-11-21
 */
@Service
public class AccessRecordServiceImpl implements IAccessRecordService 
{
    @Autowired
    private AccessRecordMapper accessRecordMapper;

    /**
     * 查询门禁记录
     * 
     * @param id 门禁记录主键
     * @return 门禁记录
     */
    @Override
    public AccessRecord selectAccessRecordById(Long id)
    {
        return accessRecordMapper.selectAccessRecordById(id);
    }

    /**
     * 查询门禁记录列表
     * 
     * @param accessRecord 门禁记录
     * @return 门禁记录
     */
    @Override
    public List<AccessRecord> selectAccessRecordList(AccessRecord accessRecord)
    {
        return accessRecordMapper.selectAccessRecordList(accessRecord);
    }

    /**
     * 新增门禁记录
     * 
     * @param accessRecord 门禁记录
     * @return 结果
     */
    @Override
    public int insertAccessRecord(AccessRecord accessRecord)
    {
        accessRecord.setCreateTime(DateUtils.getNowDate());
        return accessRecordMapper.insertAccessRecord(accessRecord);
    }

    /**
     * 修改门禁记录
     * 
     * @param accessRecord 门禁记录
     * @return 结果
     */
    @Override
    public int updateAccessRecord(AccessRecord accessRecord)
    {
        return accessRecordMapper.updateAccessRecord(accessRecord);
    }

    /**
     * 批量删除门禁记录
     * 
     * @param ids 需要删除的门禁记录主键
     * @return 结果
     */
    @Override
    public int deleteAccessRecordByIds(Long[] ids)
    {
        return accessRecordMapper.deleteAccessRecordByIds(ids);
    }

    /**
     * 删除门禁记录信息
     * 
     * @param id 门禁记录主键
     * @return 结果
     */
    @Override
    public int deleteAccessRecordById(Long id)
    {
        return accessRecordMapper.deleteAccessRecordById(id);
    }
}
